/* 
 * File:   main.cpp
 * Author: roger
 *
 * Created on 22 de Maio de 2010, 15:13
 */

#include "server.h"
#include "client.h"

/*
 * 
 */
int main(int argc, char** argv)
{
    if (argc < 3)
    {
        cerr << "Use: " << *argv << "<Modo de execução> <Interface de rede>" << endl;
        return -1;
    }

    if (strcmp(argv[1], "client")){
        Server *server = new Server(argv[2]);
        server->controlServer();
        delete server;
    } else {
        Client *client = new Client(argv[2]);
        client->controlClient();
        delete client;
    }

    return 0;
}

